package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: 朱鹏
 * @since: 2024-04-28 H O U R : {HOUR}:HOUR:{MINUTE}
 * @description:
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 批量插入菜品口味
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 删除菜品关联的口味数据
     * @param ids
     */
    void deleteFlavorByDishIdBatch(List<Long> ids);

    /**
     * 根据dishID查询菜品的口味
     * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getByDishId(Long id);
}
